Skip to content

feat: add deadline tracking to block submission#220

Merged
prestwich merged 3 commits intomainfrom
samwise/eng-1640-submit-deadline
Feb 13, 2026
Merged

feat: add deadline tracking to block submission#220
prestwich merged 3 commits intomainfrom
samwise/eng-1640-submit-deadline

Conversation

@init4samwise
Copy link
Contributor

@init4samwise init4samwise commented Feb 12, 2026

Summary

Adds a configurable deadline for bundle submission to Flashbots. Submissions that complete before the deadline log success at info level. Submissions that complete after the deadline log warnings to alert that the submission may be too late.

Related Issues

Closes ENG-1640

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Documentation
  • Refactor
  • Test coverage

Changes

  • Added new config option SUBMIT_DEADLINE_BUFFER (default 500ms) - the number of milliseconds before slot end by which submission must complete
  • Added calculate_submit_deadline() method to FlashbotsTask that computes the deadline similar to how the simulation task does
  • Modified the submission spawned task to check if submission completed before deadline
  • Added info-level logging for successful submissions within deadline
  • Added warn-level logging for submissions that miss the deadline
  • Added new metrics: signet.builder.flashbots.deadline_met and signet.builder.flashbots.deadline_missed

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed (pending CI build)

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Documentation updated (if applicable)
  • No new warnings from cargo clippy (pending CI)
  • All tests pass (cargo test) (pending CI)
  • Commit messages follow conventional format

Adds a configurable deadline for bundle submission to Flashbots.
Submissions that complete before the deadline log success at info level.
Submissions that complete after the deadline log warnings to alert that
the submission may be too late.

New configuration:
- SUBMIT_DEADLINE_BUFFER: ms before slot end by which submission must
  complete (default: 500ms)

New metrics:
- signet.builder.flashbots.deadline_met: successful submissions within deadline
- signet.builder.flashbots.deadline_missed: submissions that missed the deadline

Closes ENG-1640
// Check if we met the submission deadline
let met_deadline = Instant::now() <= deadline;

match response {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnest all this code. avoid if blocks in match arms

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done - refactored to tuple matching (response, met_deadline) with 4 flat arms. No more nested ifs in match arms.

Address PR review feedback: use tuple matching on (response, met_deadline)
instead of nested if/else blocks inside match arms. This flattens the code
structure while preserving all functionality.
@init4samwise
Copy link
Contributor Author

Addressed the review feedback - refactored to use tuple matching (response, met_deadline) instead of nested if/else blocks. The code is now flat with 4 distinct match arms covering all cases.

Commit: 14a63ac

Adds the missing submit_deadline_buffer field to the test BuilderConfig
in test_utils.rs, using the same default value (500ms) as defined in
the main config.
@init4samwise
Copy link
Contributor Author

Fixed the CI failure - added the missing submit_deadline_buffer field to the test config in test_utils.rs. The field was added to BuilderConfig but wasn't included in the test mock config.

Summary of changes in this PR:

  1. ✅ Original feature: deadline tracking for block submission
  2. ✅ Addressed prestwich's review feedback (refactored to tuple matching instead of nested if/else)
  3. ✅ Fixed CI failure (added missing test config field)

Ready for re-review once CI passes.

@prestwich prestwich merged commit 5599d6e into main Feb 13, 2026
5 checks passed
@prestwich prestwich deleted the samwise/eng-1640-submit-deadline branch February 13, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants